package ai.phase.cognition.development;
import java.io.*;

import ai.AITools;
import ai.filetools.*;
import java.util.*;

public class Frame implements CSVRowImporter{

	int j_Width;
	int j_Height;
	RegionDeltaSpec[] j_SpecArray;
	String j_FrameFileFullName;
	
	public Frame(int Width, int Height,String frameFileFullName)
	{
		j_FrameFileFullName=frameFileFullName;
		j_Width=Width;
		j_Height=Height;
		j_SpecArray= new RegionDeltaSpec[j_Width*j_Height];
		ImportFrameFile(j_FrameFileFullName);
	}
	
	private void ImportFrameFile(String frameFileFullName)
	{
		StandardTools.ImportCSVFile(j_FrameFileFullName, this, true);
	}

	@Override
	public void ImportCellData(String cell) {
		// TODO Auto-generated method stub
		
	}

	@Override
	public void ImportCellData(String cellData, int row, int column) {
		// TODO Auto-generated method stub
		int index=AITools.PointToIndex(j_Width, j_Height,column,row);
		j_SpecArray[index] = RegionDeltaSpec.CompileSpec(cellData);
	}
	
	public RegionDeltaSpec GetDeltaSpec(int index)
	{
		return j_SpecArray[index];
	}
	
}
